package org.lanqiao.taru.lanqiao_demo.common;


/**
 * 响应结果
 */
public class Result {
    private String message;    //消息
    private  Object data;      //数据
    private  Integer code;      //代码200 500

    public Integer getError() {
        return error;
    }

    public void setError(Integer error) {
        this.error = error;
    }

    private static Integer error;

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public Result(Integer code,String message, Object data) {
        this.message = message;
        this.data = data;
        this.code = code;
    }
    /**
     * 成功
     */

    public static Result success(String message,  Object data) {
        return new Result(200, message, data);
    }

    public  static Result fail(String message){

        return new Result(500, message, null);
    }
}
